﻿@using SAKS.Helpers;
@using MvcSiteMapProvider.Web.Html;
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/themes/base/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/droppy.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/saks.js")" type="text/javascript"></script>
</head>

<body>
    <div class="page">
        <div id="header">
            <div id="title">
                <h1><a href='/' >科技成果知识共享管理系统</a></h1>
            </div>
            <div id="menucontainer">

                <ul class="menu">
                @{
                    string controller = ViewContext.RouteData.Values["controller"].ToString();
                }
                    <li><a href="/Home" class='@(controller == "Home" ? "current" : "")'>首页</a></li>
                @if (HttpContext.Current.User.Identity.IsAuthenticated)
                { 
                    <li><a href="/User/MyMessages" class='@(controller == "User" ? "current" : "")'>我的主页</a></li>
                    <li><a href="/Project" class='@(controller == "Project" ? "current" : "")'>项目</a></li>
                    <li><a href="/Achievement" class='@(controller == "Achievement" ? "current" : "")'>科技成果</a></li>
                    if (HttpContext.Current.User.IsInRole("Admin") || HttpContext.Current.User.IsInRole("Editor"))
                    {
                    <li><a href="/Admin" class='@(controller == "Admin" ? "current" : "")'>管理</a></li>
                    }
                    string messagecount = HttpContext.Current.Session["unreadmessagecount"] == null ? "" : HttpContext.Current.Session["unreadmessagecount"].ToString();
                    <li><a href="/User/MyMessages#tabs-1">消息(@messagecount)</a></li>                   
                }
                @if (HttpContext.Current.User.Identity.IsAuthenticated)
                    {
                    <li><a href="/Account/LogOff">退出</a></li>
                }
                else
                {
                    string action = ViewContext.RouteData.Values["action"].ToString();

                    <li><a href="/Account/LogOn" class='@(action == "LogOn" ? "current" : "")'>登录</a></li>
                    <li><a href="/Account/Register" class='@(action == "Register" ? "current" : "")'>注册</a></li>
                }
                </ul>
            </div><!--menucontainer-->
        </div><!--header-->
        <div id="body">
            <div class="inner-page">
            @RenderBody()
            </div>
        </div><!--body-->
        <div id="footer">
            <div class="text">
                <a href="/site/about">关于我们</a> - <a href="/site/contact">联系我们</a> - <a href="/site/feedback">建议反馈</a> - <a href="/site/terms">条款协议</a>
            </div>
        </div><!--footer-->
    </div><!--page-->

</body>
</html>
